var friends=[
    {name:"why",age:18},
    {name:"zhuhaoran",age:21},
    {name:"xaihaiyan",age:20},
    {name:"yubaolian",age:21},
]

//find寻找某一个值
const  findFriend=friends.find(function(item){
    return item.name==='zhuhaoran'
})
console.log(findFriend) // {name:"zhuhaoran",age:21},

//findIndex:寻找索引值
const  findIndexFriend=friends.findIndex(function(item){
    return item.name==='zhuhaoran'
})
console.log(findIndexFriend)  //1